package com.bdcom.autotest.interaction.bean;
import com.bdcom.autotest.util.excel.IBeanToRow;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


public class TestLog  implements IBeanToRow{
	public static Map<String , Integer > beanToRow = new HashMap<String, Integer>();
	private static final long serialVersionUID = 1L;
	private Long logId;
	
	private Long timeStamp;
	
	private String res;  //成功 / 失败
	
	private String descr;  //描述 
	
	private String oemSn;  //设备SN

	private String bdSn;  //设备SN

	private String workOrder;  //设备SN


	private String mac;//耗时  秒


	private String date;//耗时  秒

	public Long getLogId() {
		return logId;
	}


	public void setLogId(Long logId) {
		this.logId = logId;
	}


	public Long getTimeStamp() {
		return timeStamp;
	}


	public void setTimeStamp(Long timeStamp) {
		this.timeStamp = timeStamp;
	}

	public String getRes() {
		return res;
	}


	public void setRes(String res) {
		this.res = res;
	}


	public String getDescr() {
		return descr;
	}


	public void setDescr(String descr) {
		this.descr = descr;
	}



	public String getOemSn() {
		return oemSn;
	}

	public void setOemSn(String oemSn) {
		this.oemSn = oemSn;
	}

	public String getBdSn() {
		return bdSn;
	}

	public void setBdSn(String bdSn) {
		this.bdSn = bdSn;
	}

	public String getWorkOrder() {
		return workOrder;
	}

	public void setWorkOrder(String workOrder) {
		this.workOrder = workOrder;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String formatDate(Long timestamp){
		
		if( timestamp ==null ){
			return "";
		}
		
		Date date = new Date(timestamp);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(date);
	}

	public String getMac() {
		return mac;
	}

	public void setMac(String mac) {
		this.mac = mac;
	}
	static{
		//
		beanToRow.put("workOrder", 0 );
		beanToRow.put("oemsn", 1 );
		beanToRow.put("bdsn", 2);
		beanToRow.put("mac", 3);
		beanToRow.put("res", 4);
		beanToRow.put("descr", 5);
		beanToRow.put("date", 6);
		//=======================================
//		beanToRow.put("", 1); //B

	}

	@Override
	public Map<String, Integer> getBeanToRow() {
		return beanToRow;
	}
}
